<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
  </body>
  <script src="./node_modules/vue/dist/vue.js"></script>
  <script>
    const MyComp = Vue.component('my-comp', {
      beforeCreate() {
        console.log('beforeCreate')
      },
      created() {
        console.log('created')
      },
      beforeMount() {
        console.log('beforeMounted')
      },
      render(h) {
        console.log('render', this.$el)
        return h('h1', 'child')
      },
      mounted() {
        console.log('mounted')
      }
    })
    const vm = new Vue({
      el: '#app',
      beforeCreate() {
        console.log('p-beforeCreate')
      },
      created() {
        console.log('p-created')
      },
      beforeMount() {
        console.log('p-beforeMounted')
      },
      render(h) {
        console.log('p-render', this.$el)
        return h('div', [h(MyComp)])
      },
      mounted() {
        console.log('p-mounted')
      },
      data() {
        return {
          hello: 'Hello'
        }
      }
    })
  </script>
</html>
